package com.squapsource.project_euler;

import java.math.BigInteger;
import java.util.HashSet;
import java.util.Set;

public class Problem29 {

	public static void main(String[] args) {
		Set<BigInteger> answers = new HashSet<BigInteger>();
		for (BigInteger a = BigInteger.valueOf(2); a.compareTo(BigInteger.valueOf(100)) <= 0; a = a.add(BigInteger.ONE)) {
			for (BigInteger b = BigInteger.valueOf(2); b.compareTo(BigInteger.valueOf(100)) <= 0; b= b.add(BigInteger.ONE)) {
				answers.add(a.pow(b.intValue()));
				System.out.println("" + a.toString() + b.toString() + a.pow(b.intValue()));
			}
		}
		System.out.println(answers.size());
	}

}
